I am not sure if it would help. But building with iOS 15 SDK (Xcode 13) might allow you to overwrite canPerformAction and buildMenu directly.
Topic:
App & System Services
SubTopic:
Core OS
Tags: